<?php echo $this->Html->script('tinymce/tinymce.min');?>
<div class="col-lg-12">

	<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-plus"></i><?= isset($this->data[$als]['id']) ? 'Sửa' : 'Thêm mới'; ?>
        </div>
    </div>


	<div class="portlet-body form">
		<?php echo $this->Form->create($als, array('class' => 'form-horizontal form-bordered', 'type' => 'file'));?>
		<?php echo $this->Form->hidden($als.'.id' )?>
		<?php echo $this->Form->hidden($als.'.fix' )?>
		<div class="portlet-body">
			<div class="form-body">
				
				<?php echo $this->element('user/web-title')?>
			
				<?php
					$isChoose = true;
					if(  (isset($this->data[$als]['parent_id']) && $this->data[$als]['parent_id'] == 0 ) 
					  || (isset($this->data[$als]['fix']) && $this->data[$als]['fix'] != 0 ) 
					)
						$isChoose = false; 
				?>
				<?php if($isChoose): ?>	 
				<div class="form-group">
					<label class="col-sm-3 control-label"><?= __('Danh mục cha');?></label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.parent_id', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'options' => $category_lists ) )?>
					</div>
				</div>
				<?php endif; ?>
				
				<div class="form-group">
					<label class="col-sm-3 control-label"><?= __('Tên'); ?></label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.name', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'placeholder' => 'Nhập tên' ) )?>
					</div>
				</div>
				
				<!-- 
				<div class="form-group">
					<label class="col-sm-3 control-label"><?= __('Tên gọi khác'); ?></label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.als', array( 'label' => false, 'div' => false, 'class' => 'form-control alias', 'placeholder' => 'ten-goi-khac' ) )?>
					</div>
				</div>
				 -->

				<div class="form-group">
					<label class="col-sm-3 control-label">Thứ tự</label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.sort', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'placeholder' => 'Nhập thứ tự' ) )?>
					</div>
				</div>
				
				<?php if( isset($this->data[$als]['is_desc']) && $this->data[$als]['is_desc'] ): ?>	
				<div class="form-group">
					<label class="col-sm-3 control-label">Miêu tả</label>
					<div class="col-sm-9">
						<?php echo $this->Form->textarea($als.'.desc', array( 'label' => false, 'div' => false, 'class' => 'form-control tnmc', 'placeholder' => 'Nhập nội dung miêu tả' ) )?>
					</div>
				</div>
				<?php endif; ?>

			</div>
			<div class="form-actions fluid">
				<div class="col-md-offset-3 col-md-9">
					<button type="submit" class="btn btn-success"><?= __('Lưu') ?></button>
					<a href="<?= $this->webroot.'admin' ?>" class="btn btn-default">Hủy bỏ</a>
				</div>
			</div>
		</div>
		<?php echo $this->Form->end( ); ?>
	</div><!-- End protet -->

</div>
